﻿using System.Configuration;

namespace DMS.Configuration
{
    public class HBConfig : ConfigurationSection
    {
        public static readonly HBConfig Setting = (HBConfig)ConfigurationManager.GetSection("hbconfig");

        public static bool IsDebugUI
        {
            get
            {
                return !string.IsNullOrWhiteSpace(ConfigurationManager.AppSettings["debug:UI"]);
            }
        }
        
        [ConfigurationProperty("BO")]
        public FOElement BO
        {
            get { return (FOElement)this["BO"]; }
        }

        [ConfigurationProperty("page-size", DefaultValue = 20)]
        public int PageSize
        {
            get { return (int)this["page-size"]; }
        }
    }

    public class FOElement : ConfigurationElement
    {
        [ConfigurationProperty("page-size", DefaultValue = 20)]
        public int PageSize
        {
            get { return (int)this["page-size"]; }
        }
    } 
}
